-
Notifications
You must be signed in to change notification settings - Fork 50
chore: add additional unit tests to increase test coverage #1708
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: add additional unit tests to increase test coverage #1708
Conversation
Summary of ChangesHello @jarebudev, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on enhancing the test coverage and robustness of the SDK by introducing several new unit tests. These tests specifically target the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request adds a suite of unit tests for various Hook implementations (BooleanHook, DoubleHook, IntegerHook, ObjectHook, StringHook) to verify the supportsFlagValueType method. It also adds a test case for ImmutableContext.merge and the necessary fixtures. The changes are a good step towards increasing test coverage. I've provided a couple of suggestions to improve the new tests: one to fix a potentially flaky test by using an order-independent assertion, and another to maintain consistency in test class visibility.
| import org.junit.jupiter.api.BeforeEach; | ||
| import org.junit.jupiter.api.Test; | ||
|
|
||
| public class ObjectHookTest implements HookFixtures { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency with the other test classes in this PR and to follow the good practice of keeping test classes package-private unless necessary, the public modifier can be removed. In JUnit 5, test classes are not required to be public.
| public class ObjectHookTest implements HookFixtures { | |
| class ObjectHookTest implements HookFixtures { |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1708 +/- ##
============================================
+ Coverage 92.00% 93.73% +1.72%
- Complexity 519 530 +11
============================================
Files 52 52
Lines 1276 1276
Branches 112 112
============================================
+ Hits 1174 1196 +22
+ Misses 64 46 -18
+ Partials 38 34 -4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: jarebudev <[email protected]>
Signed-off-by: jarebudev <[email protected]>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Todd Baert <[email protected]>
feca229 to
040fc11
Compare
|



This PR
Adds unit tests to increase test coverage. I noticed there was some missing whilst working on #1633 and seemed worth contributing these in.
Related Issues
N/A
Notes
N/A
Follow-up Tasks
N/A
How to test
N/A